import React, { Component } from 'react';
import {
    View,
    Text,
    ListView,                    //底部刷新小组件
} from 'react-native';

import { Cresumeproject_Style as styles } from '../../../../styles';
import Icon from 'react-native-vector-icons/Ionicons';
import Project_list from './cresume_project'

const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { r1 !== r2 } });//listView 数据判断方式
export default class Cresume_experience extends Component {
    // 初始化模拟数据
    constructor(props) {
        super(props);
    }
    render() {
        let dataSource = null;
        //创建listView数据源
        if (this.props.xzProjectExps != undefined) {
            dataSource = ds.cloneWithRows(this.props.xzProjectExps);
        }
        return (
            <View style={styles.pro_all}>
                <View style={styles.pro_onetop}>
                    <View style={styles.pro_topicon}>
                        <Icon
                            name={'md-cube'}
                            size={20}
                            color={'#ffffff'} />
                    </View>
                    <Text style={styles.pro_toptext}>项目经验</Text>
                </View>
                {dataSource ?
                    <ListView
                        dataSource={dataSource}
                        renderRow={this.renderRow.bind(this)}
                        enableEmptySections={true}
                    />
                    :
                    null
                }
            </View>
        );
    }

    renderRow(rowData) {
        return (
            <View>
                <Project_list
                    xzProjectExp={rowData}
                    xzResume={this.props.xzResume}
                    navigation={this.props.navigation} />
            </View>
        )
    }
}